package com.xbongbong.workflow.domain.dao;

import com.xbongbong.workflow.domain.entity.WorkflowTransferDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WorkflowTransferDataDao {
    Long insert(WorkflowTransferDataEntity entity);

    void insertBatch(List<WorkflowTransferDataEntity> list);

    WorkflowTransferDataEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(WorkflowTransferDataEntity entity);

    List<WorkflowTransferDataEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    WorkflowTransferDataEntity getByTaskId(@Param("taskId") Long taskId, @Param("corpid") String corpid);

    void deleteByTaskId(@Param("taskId") Long taskId, @Param("corpid") String corpid);

    void deleteByTaskIds(@Param("corpid") String corpid, @Param("taskIds") List<Long> taskIds);

    Integer updateBatch(@Param("list") List<WorkflowTransferDataEntity> list, @Param("corpid") String corpid);


    Integer updateDataBatch(@Param("list") List<WorkflowTransferDataEntity> list, @Param("corpid") String corpid);

    /**
     * 审批中的数据
     * @param param
     * @return
     */
    List<WorkflowTransferDataEntity> hasDataInApprovalWithData(@Param("param") Map<String, Object> param);
}